/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.bussines.entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Vogel
 */
@Entity
@Table(name = "manuales")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Manuales.findAll", query = "SELECT m FROM Manuales m"),
    @NamedQuery(name = "Manuales.findByIdManual", query = "SELECT m FROM Manuales m WHERE m.idManual = :idManual"),
    @NamedQuery(name = "Manuales.findByNomManual", query = "SELECT m FROM Manuales m WHERE m.nomManual = :nomManual"),
    @NamedQuery(name = "Manuales.findByIdioma", query = "SELECT m FROM Manuales m WHERE m.idioma = :idioma"),
    @NamedQuery(name = "Manuales.findByFechaMan", query = "SELECT m FROM Manuales m WHERE m.fechaMan = :fechaMan")})
public class Manuales implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Manual")
    private Integer idManual;
    @Size(max = 45)
    @Column(name = "Nom_Manual")
    private String nomManual;
    @Size(max = 45)
    @Column(name = "Idioma")
    private String idioma;
    @Column(name = "Fecha_Man")
    @Temporal(TemporalType.DATE)
    private Date fechaMan;
    @Lob
    @Column(name = "Manual")
    private byte[] manual;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idManual")
    private Collection<ManualesMoto> manualesMotoCollection;

    public Manuales() {
    }

    public Manuales(Integer idManual) {
        this.idManual = idManual;
    }

    public Integer getIdManual() {
        return idManual;
    }

    public void setIdManual(Integer idManual) {
        this.idManual = idManual;
    }

    public String getNomManual() {
        return nomManual;
    }

    public void setNomManual(String nomManual) {
        this.nomManual = nomManual;
    }

    public String getIdioma() {
        return idioma;
    }

    public void setIdioma(String idioma) {
        this.idioma = idioma;
    }

    public Date getFechaMan() {
        return fechaMan;
    }

    public void setFechaMan(Date fechaMan) {
        this.fechaMan = fechaMan;
    }

    public byte[] getManual() {
        return manual;
    }

    public void setManual(byte[] manual) {
        this.manual = manual;
    }

    @XmlTransient
    public Collection<ManualesMoto> getManualesMotoCollection() {
        return manualesMotoCollection;
    }

    public void setManualesMotoCollection(Collection<ManualesMoto> manualesMotoCollection) {
        this.manualesMotoCollection = manualesMotoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idManual != null ? idManual.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Manuales)) {
            return false;
        }
        Manuales other = (Manuales) object;
        if ((this.idManual == null && other.idManual != null) || (this.idManual != null && !this.idManual.equals(other.idManual))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.bussines.entities.Manuales[ idManual=" + idManual + " ]";
    }
    
}
